import type { CreateBy, SysUser, Region } from '#/entity';
import { PageForm } from '../../interface';

export namespace Address {
  export interface AddressChildren {
    id: number
    name: string
    parentId: number
    level: number
    children: AddressChildren[]
  }
  export interface CreateAddress {
    regionCode: string
    type: string
    name: string
    detail: string
    phone: string
    longitude: string
    latitude: string
    isDefault: boolean
    remark?: string
  }
  export namespace Req {
    export interface List extends PageForm {
      type?: string
    }
    export interface Create extends CreateAddress {

    }
    export interface SetDefault {
      type: string
    }
    export interface Update extends CreateAddress {
      id: string
    }
    export interface Delete {
      id: number
    }
  }
  export namespace Res {
    export interface Data {
      id: string
        sysUser: SysUser
        regionCode: string
        type: string
        name: string
        phone: string
        longitude: number
        latitude: number
        isDefault: boolean
        remark: string
        createBy: CreateBy
        createAt: string
        detail: string
        region: Region
    }
    export interface List {
      data: Data[]
      count: number
    }
    export interface Detail {
      id: string
      regionCode: string
      type: string
      name: string
      phone: string
      longitude: number
      latitude: number
      isDefault: boolean
      remark: string
      createBy: CreateBy
      createAt: string
      detail: string
      region: Region

    }
    export interface Regions {
      id: number
      name: string
      parentId: number
      level: number
      children: AddressChildren[]
    }
  }
}
